<?php
@session_start();
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Sign in &middot; TMIS Dashboard</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
<link rel="stylesheet" href="assets/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="assets/css/bootstrap-responsive.css" type="text/css" />
<link rel="stylesheet" href="assets/css/font-awesome.css" type="text/css" />
<script type="text/javascript" src="assets/js/jquery.min.js"></script>

<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-popover.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-tooltip.js"></script>
<script>
$(function ()
{ 
$("input").popover({trigger: 'focus', 'placement':'right'});

$("textarea").popover({trigger: 'focus'});


$('.btn').tooltip({'placement':'bottom', 'trigger' : 'hover'});

$('a').tooltip({'placement':'bottom', 'trigger' : 'hover'});	
});
</script>

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    
   
  </head>

  <body>
	<br/><br/>
    <div class="container">
	<div class="row">
		<div class="span4 offset4 well">
			<legend>Please Sign In<i class="icon-lock icon-2x pull-right"></i></legend>
          	
          	  <?php
	          	  if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) >0 ) {
						echo "<div class='alert alert-error'>";
						foreach($_SESSION['ERRMSG_ARR'] as $msg) {
							echo "<span><i class='icon-warning-sign'></i>&nbsp;',$msg,'</span><br/>"; 
						}
						echo '</div>';
						unset($_SESSION['ERRMSG_ARR']);
					}
					
					
					
					
					if(isset($_SESSION['logout'])){
						echo "<div class='alert alert-success'><i class='icon-ok'></i>&nbsp;" . $_SESSION['logout'] . "</div>";
						}
						unset($_SESSION['logout']);
					
					if(isset($_SESSION['user_login_need'])){
						echo "<div class='alert alert-warning'><i class='icon-warning-sign'></i>&nbsp;" . $_SESSION['user_login_need'] . "</div>";
						}
					unset($_SESSION['user_login_need']);
?>
			<form action="controller/login-exec.php" method="POST" id="regvalid" data-validate="parsley">
			

			<input type="text" class="span4" name="login" placeholder="Username" data-required="true">
			<input type="password" class="span4" name="password" placeholder="Password" data-required="true">
			
            
			<button type="submit" name="submit" class="btn btn-info btn-block" onclick="javascript:$('#regvalid').parsley( 'validate' );" rel="tooltip" title="Click to Sign in!" data-placement="bottom">Sign in&nbsp;<i class="icon-signin"></i></button>
			</form>    
		</div>
	</div>
</div>
    
    </div>
   
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="assets/js/parsley-standalone.min.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-popover.js"></script>
<script type="text/javascript" src="assets/js/bootstrap-tooltip.js"></script>

<script>
$( '#regvalid' ).parsley( {
    validators: {
      multiple: function ( val, multiple ) {
        return val % multiple === 0;
      }
    }
  , messages: {
      multiple: "This value should be a multiple of %s"
    }
} );
</script>
  </body>
</html>
<!-- Localized -->